<?php
Loader::loadFile('config.php', "modules/InnoForum");
//browser detect
Loader::loadFile('DeviceDetect.php', "modules/InnoForum/pnincludes");

Loader::loadClass('DateUtilEx', "modules/InnoForum/pnincludes");
Loader::loadClass('ObjectUtilEx', "modules/InnoForum/pnincludes");
Loader::loadClass('PNObjectEx', "modules/InnoForum/pnincludes");
Loader::loadClass('PNObjectExArray', "modules/InnoForum/pnincludes");
Loader::loadClass('DBUtilEx', "modules/InnoForum/pnincludes");
Loader::loadClass('SecurityUtilEx', "modules/InnoForum/pnincludes");
Loader::loadClass('InnoUtil', "modules/InnoForum/pnincludes");


function InnoForum_pntables()
{
    // Initialise table array
    $pntable = array();
    ////////////////////////////////////////////
    //table definition setting
    ////////////////////////////////////////////
    $pntable['innoforum_setting'] = DBUtil::getLimitedTablename('innoforum_setting');
    $pntable['innoforum_setting_column'] = array(
                                        'id'                => 'stg_id',
                                        'key'               => 'stg_name',
                                        'value'             => 'stg_value',
                                        'display_type'      => 'stg_display_type',
                                        'display_lenth'     => 'stg_display_lenth',
                                        'display_title'     => 'stg_display_title',
                                        'display_hint'      => 'stg_display_hint'
    );
    $pntable['innoforum_setting_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'key'               => 'VARCHAR(255) DEFUALT NULL',
                                        'value'             => 'TEXT DEFAULT NULL',
                                        'display_type'      => 'VARCHAR(255) DEFUALT NULL',
                                        'display_lenth'     => 'VARCHAR(10) DEFUALT NULL',
                                        'display_title'     => 'VARCHAR(255) DEFUALT NULL',
                                        'display_hint'      => 'VARCHAR(255) DEFUALT NULL'
    );
    $pntable['innoforum_setting_primary_key_column'] = 'id';

    ////////////////////////////////////////////
    //table definition type
    ////////////////////////////////////////////
    $pntable['innoforum_type'] = DBUtil::getLimitedTablename('innoforum_type');
    $pntable['innoforum_type_column'] = array(
                                        'id'                => 'tpy_id',
                                        'name'              => 'tpy_name'
    );
    $pntable['innoforum_type_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'name'              => 'VARCHAR(255) DEFUALT NULL'
    );
    $pntable['innoforum_type_primary_key_column'] = 'id';
    //$pntable['innoforum_type_language'] = array('name');

    ////////////////////////////////////////////
    //table definition category
    ////////////////////////////////////////////
    $pntable['innoforum_category'] = DBUtil::getLimitedTablename('innoforum_category');
    $pntable['innoforum_category_column'] = array(
                                        'id'                => 'cty_id',
                                        'formtype'          => 'cty_formtype',
                                        'name'              => 'cty_name',
                                        'prefix'            => 'cty_prefix',
                                        'icon'              => 'cty_icon'
    );
    $pntable['innoforum_category_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'formtype'          => 'VARCHAR(100)',
                                        'name'              => 'TEXT',
                                        'prefix'            => 'VARCHAR(5)',
                                        'icon'              => 'VARCHAR(100) DEFUALT NULL'
    );
    $pntable['innoforum_category_primary_key_column'] = 'id';
    //$pntable['innoforum_category_language'] = array('name');

    ////////////////////////////////////////////
    //table definition subcategory
    ////////////////////////////////////////////
    $pntable['innoforum_subcategory'] = DBUtil::getLimitedTablename('innoforum_subcategory');
    $pntable['innoforum_subcategory_column'] = array(
                                        'id'                => 'scy_id',
                                        'category_id'       => 'scy_category_id',
                                        'name'              => 'scy_name',
                                        'icon'              => 'scy_icon'
    );
    $pntable['innoforum_subcategory_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'category_id'       => 'INT(11) NOT NULL',
                                        'name'              => 'TEXT',
                                        'icon'              => 'VARCHAR(100) DEFUALT NULL'
    );
    $pntable['innoforum_subcategory_primary_key_column'] = 'id';
    //$pntable['innoforum_subcategory_language'] = array('name');


    ////////////////////////////////////////////
    //table definition brand
    ////////////////////////////////////////////
    $pntable['innoforum_brand'] = DBUtil::getLimitedTablename('innoforum_brand');
    $pntable['innoforum_brand_column'] = array(
                                        'id'                => 'bra_id',
                                        'name'              => 'bra_name',
                                        'icon'              => 'bra_icon'
    );
    $pntable['innoforum_brand_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'name'              => 'TEXT',
                                        'icon'              => 'VARCHAR(100) DEFUALT NULL'
    );
    $pntable['innoforum_brand_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['innoforum_brand_column'], 'bra_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['innoforum_brand_column_def']);

    ////////////////////////////////////////////
    //table definition subcategorybrand (Many to Many : Subcategory to Brand)
    ////////////////////////////////////////////
    $pntable['innoforum_subcategory_brand'] = DBUtil::getLimitedTablename('innoforum_subcategory_brand');
    $pntable['innoforum_subcategory_brand_column'] = array(
                                        'id'                => 'sbra_id',
                                        'category_id'       => 'sbra_category_id',
                                        'subcategory_id'    => 'sbra_subcategory_id',
                                        'brand_id'          => 'sbra_brand_id'
    );
    $pntable['innoforum_subcategory_brand_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'category_id'       => 'INT(11) NOT NULL',
                                        'subcategory_id'    => 'INT(11) NOT NULL',
                                        'brand_id'          => 'INT(11) NOT NULL'
    );
    $pntable['innoforum_subcategory_brand_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['innoforum_subcategory_brand_column'], 'sbra_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['innoforum_subcategory_brand_column_def']);

    ////////////////////////////////////////////
    //table definition model
    ////////////////////////////////////////////
    $pntable['innoforum_model'] = DBUtil::getLimitedTablename('innoforum_model');
    $pntable['innoforum_model_column'] = array(
                                        'id'                => 'mod_id',
                                        'brand_id'          => 'mod_brand_id',
                                        'name'              => 'mod_name'
    );
    $pntable['innoforum_model_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'brand_id'          => 'INT(11) NOT NULL',
                                        'name'              => 'TEXT'
    );
    $pntable['innoforum_model_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['innoforum_model_column'], 'mod_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['innoforum_model_column_def']);


    ////////////////////////////////////////////
    //table definition subcategorycarproperty (Many to Many : Subcategory to Brand)
    ////////////////////////////////////////////
    $pntable['innoforum_subcategory_model'] = DBUtil::getLimitedTablename('innoforum_subcategory_model');
    $pntable['innoforum_subcategory_model_column'] = array(
                                        'id'                => 'smod_id',
                                        'category_id'       => 'smod_category_id',
                                        'subcategory_id'    => 'smod_subcategory_id',
                                        'brand_id'          => 'smod_brand_id',
                                        'model_id'          => 'smod_model_id'
    );
    $pntable['innoforum_subcategory_model_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'category_id'       => 'INT(11) NOT NULL',
                                        'subcategory_id'    => 'INT(11) NOT NULL',
                                        'brand_id'          => 'INT(11) NOT NULL',
                                        'model_id'          => 'INT(11) NOT NULL'
    );
    $pntable['innoforum_subcategory_model_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['innoforum_subcategory_model_column'], 'smod_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['innoforum_subcategory_model_column_def']);

    ////////////////////////////////////////////
    //table definition property
    ////////////////////////////////////////////
    $pntable['innoforum_carproperty'] = DBUtil::getLimitedTablename('innoforum_carproperty');
    $pntable['innoforum_carproperty_column'] = array(
                                        'id'                => 'pro_id',
                                        'name'              => 'pro_name'
    );
    $pntable['innoforum_carproperty_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'name'              => 'TEXT'
    );
    $pntable['innoforum_carproperty_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['innoforum_carproperty_column'], 'pro_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['innoforum_carproperty_column_def']);

    ////////////////////////////////////////////
    //table definition subcategorycarproperty (Many to Many : Subcategory to Carproperty)
    ////////////////////////////////////////////
    $pntable['innoforum_subcategory_carproperty'] = DBUtil::getLimitedTablename('innoforum_subcategory_carproperty');
    $pntable['innoforum_subcategory_carproperty_column'] = array(
                                        'id'                => 'spro_id',
                                        'category_id'       => 'spro_category_id',
                                        'subcategory_id'    => 'spro_subcategory_id',
                                        'carproperty_id'    => 'spro_carproperty_id'
    );
    $pntable['innoforum_subcategory_carproperty_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'category_id'       => 'INT(11) NOT NULL',
                                        'subcategory_id'    => 'INT(11) NOT NULL',
                                        'carproperty_id'    => 'INT(11) NOT NULL'
    );
    $pntable['innoforum_subcategory_carproperty_primary_key_column'] = 'id';
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['innoforum_subcategory_carproperty_column'], 'spro_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['innoforum_subcategory_carproperty_column_def']);

    ////////////////////////////////////////////
    //table definition access level
    ////////////////////////////////////////////
    $pntable['innoforum_level'] = DBUtil::getLimitedTablename('innoforum_level');
    $pntable['innoforum_level_column'] = array(
                                        'id'                => 'lev_id',
                                        'name'              => 'lev_name',
                                        'level'             => 'lev_level'

    );
    $pntable['innoforum_level_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'name'              => 'VARCHAR(255) DEFAULT NULL',
                                        'level'             => 'INT(5) DEFAULT 0 '
    );
    $pntable['innoforum_level_primary_key_column'] = 'id';
    //$pntable['innoforum_level_language'] = array('name');

    ////////////////////////////////////////////
    //table definition business
    ////////////////////////////////////////////
    $pntable['innoforum_topics'] = DBUtil::getLimitedTablename('innoforum_topics');
    $pntable['innoforum_topics_column'] = array(
                                        'id'                => 'tpc_id',
                                        'type_id'           => 'tpc_type_id',
                                        'category_id'       => 'tpc_category_id',
                                        'subcategory_id'    => 'tpc_subcategory_id',
                                        'brand_id'          => 'tpc_brand_id',
                                        'model_id'          => 'tpc_model_id',
                                        'carproperty_id'    => 'tpc_carproperty_id',

                                        'ref_id'            => 'tpc_ref_id',
                                        'province'          => 'tpc_province',
                                        'title'             => 'tpc_title',
                                        'car_year'          => 'tpc_car_year',
                                        'car_gear'          => 'tpc_car_gear',
                                        'car_color'         => 'tpc_car_color',
                                        'car_kilometre'     => 'tpc_car_kilometre',
                                        'car_option'        => 'tpc_car_option',
                                        'car_brand'         => 'tpc_car_brand',
                                        'series'            => 'tpc_series',
                                        'short_detail'      => 'tpc_short_detail',
                                        'detail'            => 'tpc_detail',
                                        'productstate'      => 'tpc_productstate',
                                        'shipping'          => 'tpc_shipping',
                                        'price'             => 'tpc_price',
                                        'price_detail'      => 'tpc_price_detail',
                                        'bgcolor'           => 'tpc_bgcolor',
                                        'fgcolor'           => 'tpc_fgcolor',
                                        'tag'               => 'tpc_tag',

                                        'detail_ex1'        => 'tpc_detail_ex1',
                                        'detail_ex2'        => 'tpc_detail_ex2',
                                        'detail_ex3'        => 'tpc_detail_ex3',

                                        'name'              => 'tpc_name',
                                        'address1'          => 'tpc_address1',
                                        'address2'          => 'tpc_address2',
                                        'city'              => 'tpc_city',
                                        'state'             => 'tpc_state',
                                        'country'           => 'tpc_country',
                                        'zip'               => 'tpc_zip',

                                        'latitude'          => 'tpc_latitude',
                                        'longitude'         => 'tpc_longitude',
                                        'url'               => 'tpc_url',
                                        'email'             => 'tpc_email',
                                        'phone1'            => 'tpc_phone1',
                                        'phone2'            => 'tpc_phone2',
                                        'level'             => 'tpc_level',
                                        'ipaddress'         => 'tpc_ipaddress',
                                        'has_image'         => 'tpc_has_image',
                                        'firstimage'        => 'tpc_firstimage',
                                        'firsthumbimage'   => 'tpc_firsthumbimage',
                                        'sort'              => 'tpc_sort',
                                        'expire'            => 'tpc_expire',
                                        'count_view'        => 'tpc_count_view',
                                        'count_post'        => 'tpc_count_post',
                                        'is_sendmail'       => 'tpc_is_sendmail',
                                        'status'            => 'tpc_status',
                                        'onsale'            => 'tpc_onsale',
                                        'onsale_viewpoint'  => 'tpc_onsale_viewpoint',
                                        'update_icon'       => 'tpc_update_icon',
                                        'lastupdate'        => 'tpc_lastupdate',
                                        'isuptopic'         => 'tpc_isuptopic',
                                        'start_uptopic'     => 'tpc_start_uptopic',
                                        'expire_uptopic'    => 'tpc_expire_uptopic',
                                        'temp_cr_date'      => 'tpc_temp_cr_date',
                                        'car_registration'  => 'tpc_car_registration'
    );
    $pntable['innoforum_topics_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'type_id'           => 'INT(11) NOTNULL',
                                        'category_id'       => 'INT(11) NOTNULL',
                                        'subcategory_id'    => 'INT(11) NOTNULL',
                                        'brand_id'          => 'INT(11) NOTNULL',
                                        'model_id'          => 'INT(11) NOTNULL',
                                        'carproperty_id'    => 'VARCHAR(255)',

                                        'ref_id'            => 'VARCHAR(255)',
                                        'province'          => 'VARCHAR(255)',
                                        'title'             => 'TEXT',
                                        'car_year'          => 'INT(10)',
                                        'car_gear'          => 'VARCHAR(100)',
                                        'car_color'         => 'VARCHAR(100)',
                                        'car_kilometre'     => 'VARCHAR(100)',
                                        'car_option'        => 'TEXT',
                                        'car_brand'         => 'VARCHAR(255)',
                                        'series'            => 'VARCHAR(255)',

                                        'short_detail'      => 'TEXT',
                                        'detail'            => 'TEXT',
                                        'productstate'      => 'INT(2) DEFAULT 0',
                                        'shipping'          => 'INT(2) DEFAULT 0',
                                        'price'             => 'VARCHAR(100)',
                                        'price_detail'      => 'text',
                                        'bgcolor'           => 'VARCHAR(20)',
                                        'fgcolor'           => 'VARCHAR(20)',
                                        'tag'               => 'VARCHAR(255)',

                                        'detail_ex1'        => 'VARCHAR(255) DEFAULT NULL',
                                        'detail_ex2'        => 'VARCHAR(255) DEFAULT NULL',
                                        'detail_ex3'        => 'VARCHAR(255) DEFAULT NULL',

                                        'name'              => 'TEXT DEFUALT NULL',
                                        'address1'          => 'TEXT DEFUALT NULL',
                                        'address2'          => 'TEXT DEFUALT NULL',
                                        'city'              => 'TEXT DEFUALT NULL',
                                        'state'             => 'TEXT DEFUALT NULL',
                                        'country'           => 'TEXT DEFUALT NULL',
                                        'zip'               => 'VARCHAR(20) DEFUALT NULL',

                                        'latitude'          => 'DOUBLE',
                                        'longitude'         => 'DOUBLE',
                                        'url'               => 'VARCHAR(255) DEFUALT NULL',
                                        'email'             => 'VARCHAR(255) DEFUALT NULL',
                                        'phone1'            => 'TEXT DEFUALT NULL',
                                        'phone2'            => 'TEXT DEFUALT NULL',
                                        'level'             => 'INT(5) DEFAULT 0',
                                        'ipaddress'         => 'VARCHAR(100) DEFUALT NULL',
                                        'has_image'         => 'INT(2) DEFAULT 0',
                                        'firstimage'        => 'TEXT',
                                        'firsthumbimage'    => 'TEXT',
                                        'sort'              => 'VARCHAR(5) DEFAULT NULL',
                                        'expire'            => 'VARCHAR(255) DEFAULT NULL',
                                        'count_view'        => 'INT(11) DEFAULT 0',
                                        'count_post'        => 'INT(11) DEFAULT 0',
                                        'is_sendmail'       => 'INT(2) DEFAULT 0',
                                        'status'            => 'VARCHAR(1) DEFAULT \'F\'',
                                        'onsale'            => 'INT(1) DEFAULT 2',
                                        'onsale_viewpoint'  => 'INT(1) DEFAULT 2',
                                        'update_icon'       => 'INT(1) DEFAULT 2',
                                        'lastupdate'        => 'DATETIME',
                                        'isuptopic'         => 'INT(1) DEFAULT 2',
                                        'start_uptopic'     => 'DATETIME',
                                        'expire_uptopic'    => 'DATETIME',
                                        'temp_cr_date'      => 'DATETIME',
                                        'car_registration'  => 'INT(11) DEFAULT 0'
    );
    $pntable['innoforum_topics_primary_key_column'] = 'id';
    //$pntable['innoforum_topics_language'] = array('name','address1','address2','city','state','country','detail');
    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['innoforum_topics_column'], 'tpc_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['innoforum_topics_column_def']);

    ////////////////////////////////////////////
    //table definition topics image
    ////////////////////////////////////////////
    $pntable['innoforum_resource_image'] = DBUtil::getLimitedTablename('innoforum_resource_image');
    $pntable['innoforum_resource_image_column'] = array(
                                        'id'                => 'rsi_id',
                                        'path'              => 'rsi_path',
                                        'referer_id'        => 'rsi_referer_id',
                                        'filename'          => 'rsi_filename',
                                        'filesize'          => 'rsi_filesize',
                                        'filetype'          => 'rsi_filetype',
                                        'thumbname'         => 'rsi_thumbname',
                                        'thumbsize'         => 'rsi_thumbsize',
                                        'thumbtype'         => 'rsi_thumbtype',
                                        'type'              => 'rsi_type',
                                        'width'             => 'rsi_width',
                                        'height'            => 'rsi_height',
                                        'status'            => 'rsi_status'
    );
    $pntable['innoforum_resource_image_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'path'              => 'VARCHAR(255) DEFAULT NULL',
                                        'referer_id'        => 'INT(11) NOTNULL',
                                        'filename'          => 'TEXT DEFUALT NULL',
                                        'filesize'          => 'VARCHAR(255) DEFAULT NULL',
                                        'filetype'          => 'VARCHAR(255) DEFAULT NULL',
                                        'thumbname'         => 'TEXT DEFUALT NULL',
                                        'thumbsize'         => 'VARCHAR(255) DEFAULT NULL',
                                        'thumbtype'         => 'VARCHAR(255) DEFAULT NULL',
                                        'type'              => 'VARCHAR(50) DEFAULT NULL',
                                        'width'             => 'INT(5) DEFAULT NULL',
                                        'height'            => 'INT(5) DEFAULT NULL',
                                        'status'            => 'INT(2) DEFAULT 0'
    );
    $pntable['innoforum_resource_image_primary_key_column'] = 'id';

    ////////////////////////////////////////////
    //table definition post
    ////////////////////////////////////////////

    $pntable['innoforum_posts'] = DBUtil::getLimitedTablename('innoforum_posts');
    $pntable['innoforum_posts_column'] = array(
                                        'id'                => 'pst_id',
                                        'topics_id'         => 'pst_topics_id',
                                        'uid'               => 'pst_uid',
                                        'name'              => 'pst_name',
                                        'detail'            => 'pst_detail',
                                        'detail_ex1'        => 'pst_detail_ex1',
                                        'detail_ex2'        => 'pst_detail_ex2',
                                        'detail_ex3'        => 'pst_detail_ex3',
                                        'email'             => 'pst_email',
                                        'telephone'         => 'pst_telephone',
                                        'ipaddress'         => 'pst_ipaddress',
                                        'has_image'         => 'pst_has_image',
                                        'avatar'            => 'pst_avatar',
                                        'filename'          => 'pst_filename',
                                        'thumbname'         => 'pst_thumbname'

    );
    $pntable['innoforum_posts_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'topics_id'         => 'INT(11) NOTNULL',
                                        'uid'               => 'INT(11) NOTNULL',
                                        'name'              => 'TEXT',
                                        'detail'            => 'TEXT',
                                        'detail_ex1'        => 'VARCHAR(255) DEFAULT NULL',
                                        'detail_ex2'        => 'VARCHAR(255) DEFAULT NULL',
                                        'detail_ex3'        => 'VARCHAR(255) DEFAULT NULL',
                                        'email'             => 'VARCHAR(255) DEFAULT NULL',
                                        'telephone'         => 'VARCHAR(255) DEFAULT NULL',
                                        'ipaddress'         => 'VARCHAR(100) DEFAULT NULL',
                                        'has_image'         => 'VARCHAR(2) DEFAULT \'F\'',
                                        'avatar'            => 'VARCHAR(255) DEFAULT NULL',
                                        'filename'          => 'TEXT',
                                        'thumbname'         => 'TEXT'
    );
    $pntable['innoforum_posts_primary_key_column'] = 'id';
    //$pntable['innoforum_posts_language'] = array('name');
    
    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['innoforum_posts_column'], 'pst_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['innoforum_posts_column_def']);


    $pntable['innoforum_favourite'] = DBUtil::getLimitedTablename('innoforum_favourite');
    $pntable['innoforum_favourite_column'] = array(
                                        'id'                => 'fav_id',
                                        'topic_id'          => 'fav_topic_id',
                                        'topic_uid'         => 'fav_topic_uid',
                                        'uid'               => 'fav_uid'
    );
    $pntable['innoforum_favourite_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'topic_id'         => 'INT(11) NOTNULL',
                                        'topic_uid'        => 'INT(11) NOTNULL',
                                        'uid'               => 'INT(11) NOTNULL'
    );
    $pntable['innoforum_favourite_primary_key_column'] = 'id';
    //$pntable['innoforum_favourite_language'] = array('name');
    
    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['innoforum_favourite_column'], 'fav_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['innoforum_favourite_column_def']);

    //////////////////////////////////////////////////////////////////////////////
    //Table :: innoforum_teamtopic
    //////////////////////////////////////////////////////////////////////////////
    $pntable['innoforum_teamtopic'] = DBUtil::getLimitedTablename('innoforum_teamtopic');
    $pntable['innoforum_teamtopic_column'] = array(
                                        'id'                     => 'ttp_id',
                                        'topic_id'               => 'ttp_topic_id',
                                        'photographer_firstname' => 'ttp_photographer_firstname',
                                        'photographer_lastname'  => 'ttp_photographer_lastname' ,
                                        'poster_firstname'       => 'ttp_poster_firstname'      ,
                                        'poster_lastname'        => 'ttp_poster_lastname'       ,
                                        'collator_firstname'     => 'ttp_collator_firstname'    ,
                                        'collator_lastname'      => 'ttp_collator_lastname'     ,
                                        'poster_ad_firstname'    => 'ttp_poster_ad_firstname'   ,
                                        'poster_ad_lastname'     => 'ttp_poster_ad_lastname'    
    );
    $pntable['innoforum_teamtopic_column_def'] = array(
                                        'id'                => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'topic_id'         => 'INT(11) NOTNULL',
                                        'photographer_firstname' => 'VARCHAR(255)',
                                        'photographer_lastname'  => 'VARCHAR(255)' ,
                                        'poster_firstname'       => 'VARCHAR(255)'      ,
                                        'poster_lastname'        => 'VARCHAR(255)'       ,
                                        'collator_firstname'     => 'VARCHAR(255)'    ,
                                        'collator_lastname'      => 'VARCHAR(255)'     ,
                                        'poster_ad_firstname'    => 'VARCHAR(255)'   ,
                                        'poster_ad_lastname'     => 'VARCHAR(255)'    
    );

    $pntable['innoforum_teamtopic_primary_key_column'] = 'id';
    
    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['innoforum_teamtopic_column'], 'ttp_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['innoforum_teamtopic_column_def']);


    //////////////////////////////////////////////////////////////////////////////
    //Table :: innoforum_teamtopic
    //////////////////////////////////////////////////////////////////////////////
    $pntable['innoforum_finance'] = DBUtil::getLimitedTablename('innoforum_finance');
    $pntable['innoforum_finance_column'] = array(
                                        'id'                     => 'fin_id',
                                        'topic_id'               => 'fin_topic_id',
                                        'uid'                    => 'fin_uid',
                                        'telephone'              => 'fin_telephone'      ,
                                        'email'                  => 'fin_email'      ,
                                        'company_name'           => 'fin_company_name' ,
                                        'balance'                => 'fin_balance'      ,
                                        'interest'               => 'fin_interest'       ,
                                        'min_installment'        => 'fin_min_installment'    ,
                                        'max_installment'        => 'fin_max_installment'    ,
                                        'vat'                    => 'fin_vat'    
    );
    $pntable['innoforum_finance_column_def'] = array(
                                        'id'                     => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'topic_id'               => 'INT(11) NOTNULL',
                                        'uid'                    => 'INT(11) NOTNULL',
                                        'telephone'              => 'VARCHAR(255)'      ,
                                        'email'                  => 'VARCHAR(255)'      ,
                                        'company_name'           => 'VARCHAR(255)' ,
                                        'balance'                => 'INT(11)'      ,
                                        'interest'               => 'DOUBLE'       ,
                                        'min_installment'        => 'INT(11) DEFAULT 12'    ,
                                        'max_installment'        => 'INT(11) DEFAULT 12'    ,
                                        'vat'                    => 'INT(2) DEFAULT 1'    
    );

    $pntable['innoforum_finance_primary_key_column'] = 'id';
    
    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['innoforum_finance_column'], 'fin_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['innoforum_finance_column_def']);


    ////////////////////////////////////////////////////////////////////////////////////////////
    //Table :: innoforum_amounttopic
    ////////////////////////////////////////////////////////////////////////////////////////////
    $pntable['innoforum_amount_topic'] = DBUtil::getLimitedTablename('innoforum_amount_topic');
    $pntable['innoforum_amount_topic_column'] = array(
                                        'id'                     => 'amo_id',
                                        'uid'                    => 'amo_uid',
                                        'amount_topic'           => 'amo_amount_topic',
                                        'last_topic_id'          => 'amo_last_topic_id',
                                        'last_topic_type_id'     => 'amo_last_topic_type_id',
                                        'last_topic_title'       => 'amo_last_topic_title',
                                        'last_topic_price'       => 'amo_last_topic_price',
                                        'first_thumb'            => 'amo_first_thumb',
                                        'first_image'            => 'amo_first_image'
    );
    $pntable['innoforum_amount_topic_column_def'] = array(
                                        'id'                     => 'INT(11) NOTNULL AUTOINCREMENT PRIMARY',
                                        'uid'                    => 'INT(11) NOTNULL',
                                        'amount_topic'           => 'INT(11) DEFAULT 0',
                                        'last_topic_id'          => 'INT(11)',
                                        'last_topic_type_id'     => 'INT(11)',
                                        'last_topic_title'       => 'VARCHAR(255)',
                                        'last_topic_price'       => 'DOUBLE',
                                        'first_thumb'            => 'TEXT',
                                        'first_image'            => 'TEXT'
    );

    $pntable['innoforum_amount_topic_primary_key_column'] = 'id';
    
    // add standard data fields
    ObjectUtil::addStandardFieldsToTableDefinition ($pntable['innoforum_amount_topic_column'], 'amo_');
    ObjectUtil::addStandardFieldsToTableDataDefinition($pntable['innoforum_amount_topic_column_def']);

    return $pntable;
}